import java.util.Date;

public class MyDate implements Comparable {
    private int year=1900;
    private int month=1;
    private int day=1;
    public void setYear(int year) throws Exception {
        if(new Date(year-1900, month-1, day).getTime()>new Date().getTime()) throw new Exception("未出生");
        this.year=year;
    }
    public void setMonth(int month) throws Exception{
        if(new Date(year-1900, month-1, day).getTime()>new Date().getTime()) throw new Exception("未出生");
        this.month=month;
    }
    public void setDay(int day) throws Exception{
        if(new Date(year-1900, month-1, day).getTime()>new Date().getTime()) throw new Exception("未出生");
        this.day=day;
    }
    public MyDate(int year,int month,int day) throws Exception{
        this.setYear(year);
        this.setMonth(month);
        this.setDay(day);
    }
    public int getYear(){
        return this.year;
    }
    public int getMonth(){
        return this.month;
    }
    public int getDay(){
        return this.day;
    }
}